package com.dajie.pt.invitation.task;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;

import com.dajie.common.dubbo.util.StringUtil;
import com.dajie.pt.model.InvitationApply;
import com.dajie.pt.service.InvitationApplyService;

/**
 * 
 * @author panbing.wu
 *
 */
public class InvitationApplyTask
{

    private static final Logger logger = LoggerFactory.getLogger(InvitationApplyTask.class);
    
    @Autowired
    private InvitationApplyService<InvitationApply, Integer> invitationApplyService;
    
    public void load()
    {
    	long stime = System.currentTimeMillis();

    	try
		{
			String ids = this.invitationApplyService.getIdsByMobile("");
			if(StringUtil.isNotEmpty(ids))
			{
				this.invitationApplyService.removeByIds(ids.split(","));
			}
		} catch (Exception e)
		{
			logger.error("invitationApplyTask error:{}",e);
		}
    	logger.info("invitationApplyTask.load timecost:{}",(System.currentTimeMillis() - stime));
    }
}
